<?


class CTRLcore extends CONTROL {

	function __construct( $vars ) {
		global $Object;
		
		$this->_addvars( $vars );		
	}
	
	#	Small data transfers
	function ajax() {
		
		if( $this->action )
			return $this->{ "ajax_" . $this->action }();
	}

#	Engine core.
	function filter_account() {
		global $DB;
		
		?>
		
		<h1>Account</h1>
		
		<?
	}


	function size( $path )	{
				
		
	}
	
	private function ajax_accountsize() {
		
		//$( json.ref )[ json.func || "update" ]( json.value );
		
		
		$size = ( file_exists( $dir = ROOT . "/" . $this->ref ))?
			(( $_SESSION[ "du -s" ][ $dir ] )? $_SESSION[ "du -s" ][ $dir ] : round( (int) exec( "du -s " . escapeshellarg( $dir )) / (1024*1024), 2 )) : 0; //
				
		return 	json_encode( array( "ref"=>$this->ref, "value"=> $size . " gb" ));
	}

}








?>